<template>
  <div class="ele-body">
    <el-card shadow="never">
      <!-- 搜索表单 -->
      <el-form
        :model="where"
        label-width="96px"
        class="ele-form-search"
        @keyup.enter.native="reload"
        @submit.native.prevent>
        <el-row :gutter="15">
          <el-col :lg="4" :md="4">
            <el-form-item label="日期:" prop="add_time">
              <el-date-picker
                type="date"
                clearable
                v-model="where.add_time"

                placeholder="请输入结束时间"/>

            </el-form-item>
          </el-col>
          <el-col :lg="6" :md="6">
            <div class="ele-form-actions">
              <el-button
                type="primary"
                icon="el-icon-search"
                class="ele-btn-icon"
                @click="reload">查询
              </el-button>
              <el-button @click="reset">重置</el-button>
            </div>
          </el-col>
        </el-row>
      </el-form>
      <!-- 数据表格 -->
      <ele-pro-table
        ref="table"
        :where="where"
        :datasource="url"
        :columns="columns"
        :selection.sync="selection"
        height="calc(100vh - 315px)">
        <el-card class="analysis-chart-card" shadow="never">
          <div slot="header" class="ele-cell">
            <div class="ele-cell-content">公司应到金额</div>
            <el-tooltip content="累计收益" placement="top">
              <i
                class="el-icon-_question ele-text-placeholder"
                style="cursor: pointer;">
              </i>
            </el-tooltip>
          </div>
          <div class="analysis-chart-card-num" style="font-size: 20px;color:blue;" v-html="zoeshopprice"></div>
        </el-card>
        <el-card class="analysis-chart-card" shadow="never">
          <div slot="header" class="ele-cell">
            <div class="ele-cell-content">公司收益金额</div>
            <el-tooltip content="累计收益" placement="top">
              <i
                class="el-icon-_question ele-text-placeholder"
                style="cursor: pointer;">
              </i>
            </el-tooltip>
          </div>
          <div class="analysis-chart-card-num" style="font-size: 20px;color:blue;" v-html="shopprice"></div>
        </el-card>
        <!-- 表头工具栏 -->

        <!-- 操作列 -->
        <template slot="action" slot-scope="{row}">
        </template>
      </ele-pro-table>

    </el-card>
    <!-- 编辑弹窗 -->
    <edit
      :data="current"
      :visible.sync="showEdit"
      @done="reload"/>
  </div>
</template>

<script>
import {mapGetters} from "vuex";


export default {
  name: 'ExamUsercrad',

  computed: {
    ...mapGetters(["permission"]),
  },
  data() {
    return {
      // 表格数据接口
      url: '/income/index',
      // 表格列配置
      columns: [
        {
          columnKey: 'selection',
          type: 'selection',
          width: 45,
          align: 'center',
        },

        {
          prop: 'goods_price',
          label: '商品金额',
          showOverflowTooltip: true,
          minWidth: 200,
          align: 'center',

        },
        {
          prop: 'seat_price',
          label: '座位预约',
          showOverflowTooltip: true,
          minWidth: 200,
          align: 'center',

        },
        {
          prop: 'course_price',
          label: '包厢预约',
          showOverflowTooltip: true,
          minWidth: 200,
          align: 'center',

        },
        {
          prop: 'recharge_price',
          label: '充值金额',
          showOverflowTooltip: true,
          minWidth: 200,
          align: 'center',

        },

      ],
      // 表格搜索条件
      where: {},
      // 表格选中数据
      selection: [],
      typeList: [],
      // 当前编辑数据
      current: null,
      // 是否显示编辑弹窗
      showEdit: false,
      zoeshopprice: 0,
      shopprice: 0,
      showEdits: false,
      price: 0
    };
  },

  mounted() {
    // 获取职级列表
    this.getStoreInfo();


  },
  methods: {
    /* 刷新表格 */
    reload() {
      this.$refs.table.reload({where: this.where});
    },
    /* 重置搜索 */
    reset() {
      this.where = {};
      this.reload();
    },
    /* 显示编辑 */
    openEdit(row) {
      this.current = this.price;
      this.showEdit = true;
    },
    getStoreInfo() {
      this.$http.get('/cash/getStoreInfo').then(res => {
        if (res.data.code === 0) {
          this.price = res.data.data;

        } else {
          this.$message.error(res.data.msg);
        }
      }).catch(e => {
        this.$message.error(e.message);
      });
    },
    /* 显示编辑 */
    openEdits(row) {

      this.current = row;
      this.showEdits = true;
    },


  }
}
</script>

<style scoped>
</style>
